package com.zlt.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.zlt.annotation.Column;
import com.zlt.annotation.Id;
import com.zlt.annotation.ManyToOne;
import com.zlt.annotation.Table;

@Table(name = "dish")
public class Dish {

    @Id(name = "dish_id")
    private int did;// 菜品id

    @Column(name = "dish_name")
    @JSONField
    private String name;// 菜品名称

    @ManyToOne(name = "kind_name")
    @JSONField
    private Kind kind;// 菜品种类

    @Column(name = "dish_price")
    @JSONField
    private double price;// 菜品价格

    @Column(name = "dish_img")
    @JSONField
    private String img;// 菜品图片

    @Column(name = "dish_desc")
    @JSONField
    private String desc;// 菜品介绍

    @Column
    @JSONField
    private int state;// 菜品状态，0-正常，1-删除

    @ManyToOne(name = "user_id")
    @JSONField
    private User user;// 外键,商家

    public Dish() {
    }

    public int getDid() {
        return did;
    }

    public void setDid(int did) {
        this.did = did;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Kind getKind() {
        return kind;
    }

    public void setKind(Kind kind) {
        this.kind = kind;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "Dish{" +
                "did=" + did +
                ", name='" + name + '\'' +
                ", kind=" + kind +
                ", price=" + price +
                ", img='" + img + '\'' +
                ", desc='" + desc + '\'' +
                ", state=" + state +
                ", user=" + user +
                '}';
    }
}
